/**
 * 
 */
package name.webdizz.gadget.four.envelope.client.locale;

import com.google.gwt.core.client.GWT;

/**
 * Factory to create {@link Locale} instance.
 * 
 * @author Izzet_Mustafayev
 * 
 */
public class LocaleFactory {

	/**
	 * Holds reference to singleton instance of the {@link Locale}.
	 */
	private static Locale LOCALE;

	/**
	 * Hidden constructor to avoid instantiating of this factory.
	 */
	protected LocaleFactory() {
		super();
	}

	/**
	 * Singleton pattern implementation. Create {@link Locale} instance if it
	 * does not exist.
	 * 
	 * @return the {@link Locale} instance
	 */
	public static Locale instance() {
		if (null == LOCALE) {
			LOCALE = GWT.create(Locale.class);
		}
		return LOCALE;
	}

}
